﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Assignment2.Actions
{
    class EatingAction : Action
    {
        private Integer foodValue, hungryValue;

        /// <summary>
        /// This action decrease the amount of food and hungry
        /// </summary>
        /// <param name="foodValue">Amount of food</param>
        /// <param name="hungryValue">Amount of hungry</param>
        public EatingAction(ref Integer foodValue, ref Integer hungryValue)
        {
            this.foodValue = foodValue;
            this.hungryValue = hungryValue;
        }

        public void DoAction()
        {
            foodValue--;
            hungryValue--;
            hungryValue--;

            if (foodValue.Value <= 0)
            {
                foodValue.Value = 0;
            }
            if (hungryValue.Value <= 0)
            {
                hungryValue.Value = 0;
            }
        }
    }
}
